import lombok.Data;

/**
 * @author jcl_hqu
 * @date 2021/5/18 20:10
 */

@Data
public class Job {
    Long id;
    double arrival_time;
    double cpu_burst;
    double finish_time;
    double wait_time;
    double start_time;
    double turnaround_time;
    double weighted_turnaround_time;
    double response_ratio;
    double remaining_service_time;

    public Job(Long id, Long arrival_time, Long service_time) {
        this.id=id;
        this.arrival_time=arrival_time;
        this.cpu_burst=service_time;
    }

    public Job(Job job) {
        this.arrival_time=job.arrival_time;
        this.cpu_burst=job.cpu_burst;
        this.finish_time=job.finish_time;
        this.wait_time=job.wait_time;
        this.start_time=job.start_time;
        this.turnaround_time=job.turnaround_time;
        this.weighted_turnaround_time=job.weighted_turnaround_time;
        this.response_ratio=job.response_ratio;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Job job = (Job) o;

        return id != null ? id.equals(job.id) : job.id == null;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}
